package com.ywu.application.standard.appManage.api;

import com.ywu.application.standard.appManage.dto.YwuAppUserDto;
import com.ywu.application.standard.appManage.service.YwuAppUserService;
import com.ywu.common.result.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuAppUserApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/7/29 20:11
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/app/user")
public class YwuAppUserApi {
    @Autowired
    private YwuAppUserService service;
    
    /**
    * @Author GroundDemo
    * @Description 分页查询
    * @Date 20:21 2024/7/29
    * @Param [ywuAppUserDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/app.user.query.page.list")
    public CommonResult<Object> appUserQueryPageList(@RequestBody YwuAppUserDto ywuAppUserDto) {
        return service.appUserQueryPageList(ywuAppUserDto);
    }

    /**
    * @Author GroundDemo
    * @Description 创建用户与应用的关联关系
    * @Date 20:27 2024/7/29
    * @Param [ywuAppUserDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/app.user.create.info")
    public CommonResult<Object> appUserCreateInfo(@RequestBody YwuAppUserDto ywuAppUserDto) {
        return service.appUserCreateInfo(ywuAppUserDto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除用户与应用的关联关系
    * @Date 20:34 2024/7/29
    * @Param [ywuAppUserDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/app.user.delete.info")
    public CommonResult<Object> appUserDeleteInfo(@RequestBody YwuAppUserDto ywuAppUserDto) {
        return service.appUserDeleteInfo(ywuAppUserDto);
    }

    /**
    * @Author GroundDemo
    * @Description 根据用户id删除授权信息
    * @Date 19:59 2025/3/26
    * @Param [ywuAppUserDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/app.user.delete.info.by.user.id.for.spi")
    public CommonResult<Object> appUserDeleteInfoByUserId(@RequestBody YwuAppUserDto ywuAppUserDto) {
        return service.appUserDeleteInfoByUserId(ywuAppUserDto);
    }
}
